package com.lanswon.icc.common.rpc.feign;

import com.lanswon.icc.common.core.constant.SecurityConstant;
import com.lanswon.icc.common.core.dto.UserInfo;
import com.lanswon.icc.common.core.vo.Result;
import com.lanswon.icc.common.rpc.feign.fallbackfactory.AdminServiceFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(value = "admin",fallbackFactory = AdminServiceFeignFallbackFactory.class)
public interface AdminServiceFeign {

    @GetMapping("/user/info/{username}")
    public Result<UserInfo> findByUsername(@PathVariable(value = "username") String username, @RequestHeader(SecurityConstant.FROM) String from);

    @GetMapping("/user/info/{username}")
    Result<UserInfo> findByMobile(@PathVariable(value = "mobile")String mobile, @RequestHeader(SecurityConstant.FROM) String from);

//    @PostMapping("/log")
//    public Result<String> saveSysLog(@RequestBody SysLog sysLog);
}
